Function Reference

_AD_GetObjectClass

Returns the main class (also called structural class) of an object ("user", "group" etc.).

#Include <AD.au3>
_AD_GetObjectClass($sObject[, $bAll = False])

 

Parameters

$sObject Object for which the main class should be returned. Can be specified as Fully Qualified Domain Name (FQDN) or sAMAccountName
$bAll Optional: Returns the main class plus the superior classes from which the main class is deduced hierarchically (default = False)

 

Return Value

Success: Main class of the specified object if $bAll = False or an zero-based array of the main plus the superior classes if $bAll = True
Failure: "", sets @error to:
    1 - Specified object does not exist
    2 - The LDAP query returned no record. @extended is set to the error returned by LDAP

 

Remarks

None.

 

Related

 

Example


#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
; *****************************************************************************
; Example 1
; Displays the class for the logged on user and local computer.
; *****************************************************************************
#include <AD.au3>

; Open Connection to the Active Directory
_AD_Open()
If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)

; Return class for the logged on user and local computer
MsgBox(64, "Active Directory Functions - Example 1", _
        "Class for logged on user: " & _AD_GetObjectClass(@UserName) & @CRLF & _
        "Class for local computer: " & _AD_GetObjectClass(@ComputerName & "$"))

; Close Connection to the Active Directory
_AD_Close()